﻿namespace SuperCalculator
{
    public class FunctionInfo
    {
        /// <summary>
        /// 获取或设置函数名称。
        /// </summary>
        public string Name { get; set; }


        /// <summary>
        /// 代码文件的相对路径, 如要使用绝对路径请在前面加上Function.DirectoryOfFunctions。 
        /// </summary>
        public string RelativePathOfCodeFile { get; set; }

        /// <summary>
        /// 获取或设置其说明性信息
        /// </summary>
        public string ExplainInfo { get; set; }

        public FunctionInfo()
        {
            Name = "";
            RelativePathOfCodeFile = "";
            ExplainInfo = "";
        }

        /// <summary>
        /// 构造函数。
        /// </summary>
        /// <param name="name">函数名称。</param>
        /// <param name="pathOfCodeFile">代码文件路径, 重要: 请一定使用相对路径。</param>
        /// <param name="explainInfo">该函数的附加说明信息。</param>
        public FunctionInfo(string name, string pathOfCodeFile, string explainInfo)
        {
            Name = name;
            RelativePathOfCodeFile = pathOfCodeFile;

            if (string.IsNullOrEmpty(explainInfo)) ExplainInfo = name;
            else ExplainInfo = explainInfo;
        }
    }
}
